﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using HAOest.Diandi.Model;

namespace HAOest.DianDi.UI.Control
{
    /// <summary>
    /// NoteItemControl.xaml 的交互逻辑
    /// </summary>
    public partial class NoteItemControl : UserControl
    {
        private int id;
        private string contentText;
        private DateTime date;

        public int Id
        {
            get { return this.id; }
        }

        public string ContentText
        {
            get { return this.contentText; }
        }

        public string Date
        {
            get { return this.date.ToString("yyyy-MM-dd H:mm:ss"); }
        }

        public NoteItemControl()
        {
            InitializeComponent();
        }

        public NoteItemControl(NoteItem noteItem)
        {
            InitializeComponent();
            this.id = noteItem.Id;
            this.contentText = noteItem.ContentText;
            this.date = noteItem.Date;
            DataContext = this;
        }
    }
}
